#include "include.h"
#include "gui\gui.h"

#ifdef USE_QT

#include "adapters/qt_mainwindow_adapter.h"

using namespace gui;
using namespace qtgui;


#include "compile/debug_memoryleaks"



static MainWindowQT* _the_MyQMainWindow_instance = NULL;


void Gui::buildView()
{
	_the_MyQMainWindow_instance  = new MainWindowQT(&guieventdispatcher, invoker);
	QWidget* widget = _the_MyQMainWindow_instance->getWidget();	

	GraphicViewQT* graphicviewqt = GraphicViewQT::create(widget);
    this->graphicview = graphicviewqt;


	_the_MyQMainWindow_instance->show();
}



void Gui::destroyView()
{
    if (graphicview!=NULL)
    {
        delete graphicview;
        graphicview = NULL;
    }

    if( _the_MyQMainWindow_instance)
    {
        delete _the_MyQMainWindow_instance;
        _the_MyQMainWindow_instance =NULL;
    }
}

#endif
